<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
      div{
        width: 100px;
        height: 100px;
        background: red;
      }
    </style>
  </head>
  <body>
    <!-- 
      fadeIn()
        淡入
      fadeOut()
        淡出
      fadeToggle()
        切换  
      fadeTo(时间, 透明度)
        将透明度设置到对应的值

      时间和回调函数
    -->
    <button>按钮</button>
    <hr>
    <div></div>
  <script src="../libs/jquery-1.12.4.js"></script>

  <script>
    $('button').on('click', function () {
      $('div').fadeToggle(3000)
    })
  </script>
</body>
</html>